package javaer.starter.base.domain.model;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.AccessLevel;
import lombok.Data;
import lombok.experimental.FieldDefaults;

import java.io.Serializable;

/**
 * 数据库基础字段
 *
 * @author yangzhen
 * @date 2023/6/5 10:55
 * @since 1.0.0
 */
@Data
@FieldDefaults(level = AccessLevel.PRIVATE)
public class BaseModel implements Serializable {

    @TableId(type = IdType.AUTO)
    Long id;

    @JsonIgnore
    @TableField(fill = FieldFill.INSERT)
    Long gmtCreate;

    @JsonIgnore
    @TableField(fill = FieldFill.INSERT_UPDATE)
    Long gmtModified;

}
